package com.gaofans.nrpc.common.protocol;

/**
 * @author GaoFans
 */
public class RpcResponse extends Message {

    /**
     * 异常信息
     */
    private String error;
    /**
     * 返回结果
     */
    private Object result;
    /**
     * 是否有返回值
     */
    private boolean isVoid;
    /**
     * 是否成功
     */
    private boolean isSuccess;
    /**
     * 是否是流
     */
    private boolean isStream;
    /**
     * 是否结束
     */
    private boolean isEnd;

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    public boolean isVoid() {
        return isVoid;
    }

    public void setVoid(boolean aVoid) {
        isVoid = aVoid;
    }

    public boolean isSuccess() {
        return isSuccess;
    }

    public void setSuccess(boolean success) {
        isSuccess = success;
    }

    @Override
    public byte getType() {
        return Message.RPC_RESPONSE;
    }

    public boolean isStream() {
        return isStream;
    }

    public void setStream(boolean stream) {
        isStream = stream;
    }

    public boolean isEnd() {
        return isEnd;
    }

    public void setEnd(boolean end) {
        isEnd = end;
    }
}
